<template>  <div class="learning-time-grid">
    <div class="learning-time-item" v-for="stat in stats" :key="stat.label">
      <span class="stat-label">{{ stat.label }}</span>
      <span class="stat-value">{{ stat.value }}</span>
      <span class="time-unit">min</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "LearningTimeStats",
  props: {
    yesterdayTime: {
      type: [Number, String],
      default: 0
    },
    weeklyTime: {
      type: [Number, String], 
      default: 0
    }
  },
  computed: {
    stats() {
      return [
        {
          label: "昨日学习时长：",
          value: this.yesterdayTime
        },
        {
          label: "近七日学习时长：",
          value: this.weeklyTime
        }
      ];
    }
  }
};
</script>

<style scoped>
.learning-time-grid {
  display: flex;
  justify-content: space-between;
  margin: 15px 0px 0px 0px;
  gap: 10px;
}

.learning-time-item {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 8px;
  backdrop-filter: blur(5px);
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9) !important;
  margin-bottom: 6px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 20px;
  color: rgba(255, 255, 255, 1) !important;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 2px;
}

.time-unit {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 707px) {
  .learning-time-grid {
    flex-direction: column;
    gap: 8px;
    margin: 15px 0px;
  }
  
  .learning-time-item {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  
  .stat-value,
  .time-unit {
    margin: 0;
  }
}
</style>
